import {createRouter, createWebHistory} from 'vue-router';
import Layout from "../pages/Layout/Layout.vue";
import Home from "../pages/Home/Home.vue";
import AddScheme from "../pages/AddScheme/AddScheme.vue";
import Login from "../pages/Login/Login.vue";
import Firewall from "../pages/Firewall/Firewall.vue";
import Total from "../pages/Total/Total.vue";
import API from "../pages/API/API.vue";


const routes = [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        children: [
            {
                path: '',
                name: 'Home',
                component: Home,
            },
            {
                path: 'editor',
                name: 'Editor',
                component: () => import('../components/Editor/Editor.vue')
            },
            {
                path: 'addscheme',
                name: 'AddScheme',
                component: AddScheme
            },
            {
                path: 'firewall',
                name: 'Firewall',
                component: Firewall
            },
            {
                path: 'total',
                name: 'Total',
                component: Total
            }
        ],
    },
    {
        path: '/api',
        name: 'API',
        component: API
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
